package com.smart.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smart.service.LoginService;
import com.smart.tools.ResponseMsg;

/**
 * 
 * 版权所有：xxxxxxx
 * @Description: 登录
 * @Title: LoginController.java 
 * @ClassName: LoginController 
 * @author tangyan 
 * @date 2019年2月13日 下午7:29:09 
 * @version V1.0
 */
@Controller
@RequestMapping("/login")
public  class LoginController {

	@Autowired
	private LoginService loginService;
	
	@RequestMapping(value = "/toLogin")
    @ResponseBody
    public ResponseMsg toLogin(HttpServletRequest request) {
		ResponseMsg msg = new ResponseMsg();
		msg.setStatus(0);
		return msg;
		
		/*//获取登录信息
		String loginInfo =	request.getParameter("loginInfo");
		//解密
		String loginInfoDecode =	Base64.decode(loginInfo);
		String[] loginArr = loginInfoDecode.split("&");
		
		//登录IP
		String loginIp = GetClientIp.getIpAddr(request);
		
		ResponseMsg msg = new ResponseMsg();
		try {
			Login login = loginService.toLogin(loginArr[0], loginArr[1], Login.LOGIN_DEV_TYPE_PCB, loginIp);
			//将登录信息设置到session 中
			request.getSession().setAttribute("login", login);
			msg.setStatus(ResponseMsg.RESULT_STATUS_SUCESS);
		} catch (Exception e) {
			msg.setStatus(ResponseMsg.RESULT_STATUS_ERROR);
			msg.setMsg(e.getMessage());
		}
		
		
		return msg;*/
    }
    
}
